﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

using Twilio.TwilML.BaseTypes;

namespace Twilio.TwilML
{
    public enum Voice
    {
        [XmlEnum("man")] Man,
        [XmlEnum("woman")] Woman,
    }

    public enum Language
    {
        [XmlEnum("en")] English,
        [XmlEnum("es")] Spanish,
        [XmlEnum("fr")] French,
        [XmlEnum("de")] German,
    }

    [XmlRoot("Say")]
    public class Say : GatherVerb
    {
        [XmlAttribute("voice"), DefaultValue(Voice.Man)]
        public Voice Voice { get; set; }

        [XmlAttribute("language"), DefaultValue(Language.English)]
        public Language Language { get; set; }

        [XmlAttribute("loop"), DefaultValue(1)]
        public int Loop { get; set; }

        [XmlText]
        public string Message { get; set; }

        public Say()
        {
            Voice = Voice.Man;
            Language = Language.English;
            Loop = 1;
        }

        public Say(string message, params object[] args) : this(String.Format(message, args)) { }
        public Say(string message) : this()
        {
            Message = message;
        }
        
    }
}
